home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / os2tools / devshell / devshell.cmd < prev    next >
Encoding:
Text File  |  1991-12-08  |  25.5 KB  |  766 lines

  1. /*------------------------------------------------------*/
  2. /*         DevShell - Developers Shell                  */
  3. /*         Version 1.0 $Revision: 1.7 $                 */
  4. /*     (C) Copyright 1991 Frank V. Castellucci          */
  5. /*             All Rights Reserved                      */
  6. /*------------------------------------------------------*/
  7.  
  8. /*------------------------------------------------------*/
  9. /*  Global variable areas                               */
  10. /*------------------------------------------------------*/
  11.  
  12. Config.maxcfg   = 0;
  13. Config.maxalias = 0;
  14. Config.maxvol   = 0;
  15.                 
  16. CntlShell.      = "";
  17. OpenFiles.      = "";
  18.  
  19. Commands.num    = 0;
  20. Commands.cur    = "";
  21.  
  22. /*  Pull command line arguments             */
  23.  
  24. Parse Upper Arg CommandLine
  25.  
  26. /*  Fetch count of arguments                */
  27.  
  28. argc = GetArgC(CommandLine);
  29.  
  30. if(argc > 0) then do
  31.     Commands.cur = CommandLine;
  32.     end
  33.  
  34. /*------------------------------------------*/
  35. /*  If the configuration file inits ok, loop*/
  36. /*  through user input until the exit or    */
  37. /*  quit command is entered.                */
  38. /*------------------------------------------*/
  39.  
  40. if(InitConfig(argc,CommandLine) = "READY:") then do
  41.     do until (i=0)
  42.         i=FetchInput();
  43.         if( i > 0 & i <> 'ffff'x) then do
  44.             r=dispatch(i,Commands.cur);
  45.             end
  46.         end
  47.     End
  48.     
  49. else do
  50.     say "Error in configuration file management"
  51.     end
  52.     
  53. /*------------------------------*/
  54. /* The only exit in the house   */
  55. /*------------------------------*/
  56.     
  57. exit i;
  58.  
  59. /*------------------------------------------------------*/
  60. /*  Displays Header Information                         */
  61. /*------------------------------------------------------*/
  62. Header: procedure
  63. say; say;
  64.  
  65. loop = 1;
  66. do until LEFT(sourceline(loop),4) = "    "
  67.     String = sourceline(loop);
  68.     if(LEFT(String,4) = "more" | LEFT(String,4) = "More") then do
  69.         r=lineout(,"Press [ENTER] to continue");
  70.         linein()
  71.         end
  72.     else do
  73.         r=lineout(,String);
  74.         end
  75.     loop = loop+1;
  76.     end
  77.  
  78. return;
  79.  
  80. /*------------------------------------------------------*/
  81. /*  Routine to fetch number of arguments passed by user */
  82. /*------------------------------------------------------*/
  83.  
  84. GetArgC: procedure 
  85. BigString = Arg(1)
  86. count = 0
  87. do while(BigString <> "")
  88.     Parse Var BigString Drop BigString
  89.     count = count+1
  90.     end
  91.     
  92. return count;
  93.  
  94. /*------------------------------------------------------*/
  95. /*  Routine to fetch additional command line arguments  */
  96. /*  Here argv. is exposed to pass the information to    */
  97. /*  other functions either locally or externally        */
  98. /*------------------------------------------------------*/
  99.  
  100. FetchInput: procedure expose Commands.
  101.  
  102. r=charout(,"0d0a"x"[ready]: ")
  103. parse value linein() with Ops
  104.  
  105. i = GetArgC(Ops);
  106.  
  107. if( i > 0) then do
  108.     PARSE UPPER VAR Ops argv0 rest
  109.     if(argv0 = 'EXIT' | argv0 = 'QUIT') then do
  110.         i = 0;
  111.         end
  112.     end
  113.  
  114.     /*  Otherwise the enter key was hit with no input   */
  115.     
  116. else do
  117.     i = 'ffff'x;
  118.     end
  119.     
  120. if( i > 0 & i <> 'ffff'x) then do
  121.     t = Commands.num
  122.     Commands.t = Ops
  123.     Commands.cur = Ops
  124.     Commands.num = t+1
  125.     end
  126.         
  127. return i;
  128.  
  129. /*------------------------------------------------------*/
  130. /*  Dispatch what the user wanted to call us for        */
  131. /*  Argc    -   Counts of words in entry string         */
  132. /*  Ops     -   Fully entered string                    */
  133. /*  Spare   -   Same, I forget why?                     */
  134. /*------------------------------------------------------*/
  135.  
  136. DisPatch: procedure expose Config. Commands. CntlShell.
  137.  
  138. argc    = Arg(1)
  139. Ops     = Arg(2)
  140. spare   = Arg(2)
  141.  
  142. HlpStr = '@call 'CntlShell.HELP'\devman()';  
  143.  
  144.     /*------------------------------------------------------*/
  145.     /*    Parse out arguments into automatic array          */
  146.     /*------------------------------------------------------*/
  147.     
  148.     i = 0
  149.     do while ( i < argc )
  150.         if( i = 0 ) then do
  151.             parse var Ops argv.i Ops
  152.             end
  153.         else do
  154.             parse var Ops argv.i Ops
  155.             end
  156.         
  157.         i = i+1
  158.         end
  159.     
  160.     
  161.     results = 1;                        /*  Return status       */
  162.     uparg0  = translate(argv.0);        /*  Force upper case    */
  163.     
  164.     select  
  165.         /*--------------------------------------------------------------*/
  166.         /*  If the argument is a number, we assume a stacked command    */
  167.         /*--------------------------------------------------------------*/
  168.         when (datatype( argv.0 ) = "NUM") then do
  169.             Commands.num = Commands.num - 1;         
  170.             if(argv.0 < Commands.num) then do
  171.                 t = argv.0
  172.                 results = dispatch(GetArgC(Commands.t),Commands.t)
  173.                 end
  174.             else do
  175.                 r=lineout(,argv.0 "not in command stack");
  176.                 end
  177.             end
  178.             
  179.         /*--------------------------------------------------------------*/         
  180.         /*  Direct call to the operating system, we first remove 'OS'   */
  181.         /*--------------------------------------------------------------*/
  182.         
  183.         when(uparg0 = 'OS') then do
  184.             parse var spare dump spare
  185.             spare
  186.             results = 0;
  187.             end
  188.             
  189.         /*--------------------------------------------------------------*/ 
  190.         /*  Query Options Command                                       */
  191.         /*--------------------------------------------------------------*/ 
  192.         
  193.         when (argv.0 = "?" | uparg0 = "HELP") then do
  194.             if(argc > 1) then do
  195.                 push argv.1;
  196.                 end
  197.             else do
  198.                 push "";
  199.                 end
  200.             HlpStr;
  201.             end
  202.             
  203.         /*--------------------------------------------------------------*/ 
  204.         /*  Display alias list as currently assigned                    */
  205.         /*--------------------------------------------------------------*/ 
  206.         
  207.         when ( uparg0 = 'ALIAS' ) then do
  208.             i=0
  209.             do while(i < Config.maxalias)
  210.                 t = Config.i
  211.                 string = LEFT(Config.i,15) "=" Config.i.t
  212.                 r=lineout(,string);
  213.                 i = i+1
  214.                 end
  215.             end
  216.             
  217.         /*--------------------------------------------------------------*/   
  218.         /*  Change or add an alias string                               */
  219.         /*--------------------------------------------------------------*/
  220.         
  221.         when ( uparg0 = 'ASET' ) then do
  222.             if(argc > 2) then do
  223.                 i=0;
  224.                 t=0;
  225.                 Ops = argv.1;
  226.                 parse var spare dummy0 dummy1 argv.2 
  227.                 
  228.                 do while( i < Config.maxalias)
  229.                     if(compare(Config.i,Ops) = 0) then do
  230.                         Config.i.Ops = argv.2
  231.                         i = Config.maxalias;
  232.                         t = 1;
  233.                         end
  234.                     i = i+1;
  235.                     end
  236.                     
  237.                 if( t = 0 ) then do
  238.                     i = Config.maxalias;
  239.                     Config.i = Ops;
  240.                     Config.i.Ops = argv.2;
  241.                     i = i+1;
  242.                     Config.maxalias = i;
  243.                     end
  244.                 end
  245.             else do
  246.                 push 'ASET';
  247.                 HlpStr;
  248.                 end
  249.             end
  250.             
  251.         /*--------------------------------------------------------------*/ 
  252.         /*  Display configuration list as current                       */
  253.         /*--------------------------------------------------------------*/         
  254.         
  255.         when ( uparg0 = 'CONFIG' ) then do
  256.             i = 0;
  257.             do while(i < Config.maxcfg)
  258.                 r=lineout(,LEFT("Config."Config.FUNCTIONS.i,15) "=",
  259.                                          Config.FUNCTIONS.i.0);
  260.                 i = i+1;
  261.                 end
  262.             end
  263.         
  264.         /*--------------------------------------------------------------*/ 
  265.         /*  Change or add a configuration string                        */
  266.         /*--------------------------------------------------------------*/ 
  267.         
  268.         when ( uparg0 = 'CSET') then do
  269.    
  270.             if(argc > 2) then do
  271.                 parse var spare dummy Ops;
  272.                 CfgCmd = "";
  273.                 CfgCmd = CheckConfig(Ops);
  274.             
  275.                 if( CfgCmd <> "") then do
  276.                     CfgCmd = translate(argv.1);
  277.                     t=0;
  278.                     do while( Config.FUNCTIONS.t <> CfgCmd )
  279.                         t = t+1;
  280.                         end
  281.                     Config.FUNCTIONS.t.0 = argv.2;
  282.                     end          
  283.                 else do
  284.                     CfgCmd = translate(argv.1);
  285.                     t=Config.maxcfg;
  286.                     Config.FUNCTIONS.t = CfgCmd;
  287.                     Config.FUNCTIONS.t.0 = argv.2;
  288.                     Config.maxcfg = Config.maxcfg + 1;
  289.                     end
  290.                 end
  291.             else do
  292.                 push 'CSET';
  293.                 HlpStr;
  294.                 end
  295.             end
  296.             
  297.         /*--------------------------------------------------------------*/ 
  298.         /*  Display the command stack                                   */
  299.         /*--------------------------------------------------------------*/ 
  300.         
  301.         when ( uparg0 = 'COMSTACK' | uparg0 = 'COMS') then do
  302.             i = 0
  303.             do while( i < Commands.num)
  304.                 string = LEFT(i,5)" "Commands.i
  305.                 r=lineout(,string);
  306.                 i = i+1
  307.                 end
  308.             end
  309.  
  310.         /*--------------------------------------------------------------*/ 
  311.         /*  Change to directory listed in volser list, or do direct     */
  312.         /*--------------------------------------------------------------*/ 
  313.         
  314.         when ( uparg0 = 'GO' ) then do
  315.             if(argc > 1) then do
  316.                 NewVol = CheckVolumes(argv.1);
  317.                 if(NewVol <> "") then do
  318.                     CntlShell.CurDir = directory(NewVol);
  319.                     end
  320.                 else do
  321.                     NewVol = directory(argv.1);
  322.                     if(NewVol <> "" ) then do
  323.                         CntlShell.CurDir = NewVol;
  324.                         end
  325.                     else do
  326.                         r=lineout(,"VOL assignment "argv.1" not found");
  327.                         r=lineout(,"and directory change returned error");
  328.                         end
  329.                     end
  330.                 end
  331.             else do
  332.                 push 'GO';
  333.                 HlpStr;
  334.                 end
  335.             end
  336.             
  337.         /*--------------------------------------------------------------*/     
  338.         /*  Go to directory listed in the config file                   */
  339.         /*--------------------------------------------------------------*/ 
  340.         
  341.         when ( uparg0 = 'HOME' ) then do
  342.             CntlShell.CurDir = directory(CntlShell.Home);
  343.             end
  344.         
  345.         /*--------------------------------------------------------------*/ 
  346.         /*  Reinitialize the configuration file, assumed edited         */
  347.         /*--------------------------------------------------------------*/ 
  348.         
  349.         when (uparg0 = "REINIT") then do
  350.             results = InitConfig(0);
  351.             end
  352.         
  353.         /*--------------------------------------------------------------*/ 
  354.         /*  List volumes assigned from configuration file, or session   */
  355.         /*--------------------------------------------------------------*/ 
  356.         
  357.         when ( uparg0 = 'VOLUMES' ) then do
  358.             i=0;
  359.             do while(i < Config.maxvol)
  360.                 r=lineout(,LEFT("VOL."Config.VOLSERS.i,15) "=",
  361.                                         Config.VOLSERS.i.0);
  362.                 i = i+1;
  363.                 end
  364.             end
  365.             
  366.         /*--------------------------------------------------------------*/     
  367.         /*  Change or add volume look-aside assignment                  */
  368.         /*--------------------------------------------------------------*/ 
  369.         
  370.         when ( uparg0 = 'VSET') then do
  371.             if(argc > 2) then do
  372.                 NewVol = "";
  373.                 NewVol = CheckVolumes(argv.1);
  374.                 if(NewVol <> "") then do
  375.                     t=0;
  376.                     do while(Config.VOLSERS.t <> argv.1)
  377.                         t=t+1;
  378.                         end
  379.                     Config.VOLSERS.t.0 = argv.2;
  380.                     end
  381.                 else do
  382.                     t = Config.maxvol;
  383.                     Config.VOLSERS.t = argv.1;
  384.                     Config.VOLSERS.t.0 = argv.2;
  385.                     Config.maxvol = Config.maxvol +1;
  386.                     end
  387.                 end
  388.             else do
  389.                 push 'ASET';
  390.                 HlpStr;
  391.                 end
  392.             end
  393.         
  394.         /*--------------------------------------------------------------*/ 
  395.         /*  Falling through we check configuration cross-reference or   */
  396.         /*  alias command strings, worst case we report an error        */
  397.         /*--------------------------------------------------------------*/ 
  398.         
  399.         otherwise
  400.             CfgCmd = "";
  401.             CfgCmd = CheckConfig(spare);
  402.         
  403.             if(CfgCmd <> "" ) then do
  404.                 if(argc > 1) then do
  405.                     CfgCmd argv.1
  406.                     end
  407.                 else do
  408.                     CfgCmd
  409.                     end
  410.                 end
  411.             
  412.             else if( CheckAlias(spare) = 1) then do
  413.                 r=lineout(,"Unknown command " spare);
  414.                 end
  415.                 
  416.         end
  417.         
  418. return results;
  419.  
  420. /*------------------------------------------------------*/
  421. /*  Loads configuration file and checks for alternate   */
  422. /*  Potential Arguments:                                */
  423. /*                      -C Alternate Config File        */
  424. /*------------------------------------------------------*/
  425.  
  426. InitConfig:procedure expose Config. CntlShell.
  427.  
  428. Arg argc Ops
  429.  
  430. cfgfile = "DSHELL.CFG"                  /*  Default Name            */
  431. Call Header;                            /*  Show Header             */
  432.  
  433. Config. = "";                           /*  Reset alias and config  */
  434. Config.maxalias = 0;                    /*  Loop control alias      */
  435. Config.maxcfg   = 0;                    /*  Loop control configs    */
  436. Config.maxvol   = 0;                    /*  Loop control volsers    */
  437.  
  438. CntlShell.CurDir = directory();         /*  Get Current Directory   */
  439.  
  440.     /*--------------------------------------------------*/
  441.     /*  The following assumes that we are in a re-init  */
  442.     /*  state as called by user. This is based on the   */
  443.     /*  re-init argument values of 0 and NULL           */
  444.     /*--------------------------------------------------*/
  445.     
  446. if(CntlShell.Home <> "") then do
  447.     if(CntlShell.Home <> CntlShell.CurDir) then do
  448.         cfgfile = CntlShell.Home'\'CntlShell.Cfg;
  449.         end
  450.     end
  451.  
  452.  
  453. if( argc > 0 ) then do
  454.     PARSE UPPER VAR Ops argv.0 argv.1 argv.2 argv.3 argv.4 argv.5 argv.6 argv.7
  455.     l = 0
  456.     
  457.     do while( l < argc )
  458.         if( LEFT(argv.l,2) = "-C" | LEFT(argv.l,2) = "-c") then do
  459.             len = LENGTH(argv.l);
  460.             len = len - 2;
  461.             cfgfile = COPIES(RIGHT(argv.l,len),1)
  462.             r=lineout(,"Alternate configuration file used " cfgfile);
  463.             end
  464.             
  465.         else if(LEFT(argv.l,2) = "-D" | LEFT(argv.l.2) = "-d") then do
  466.             len = LENGTH(argv.l);
  467.             len = len - 2;
  468.             CntlShell.CurDir = directory(COPIES(RIGHT(argv.l,len),1));
  469.             r=lineout(,"Home directory set to " CntlShell.CurDir);
  470.             end
  471.             
  472.         l = l+1    
  473.         end
  474.     end
  475.     
  476. state=stream(cfgfile,c,"OPEN");                 /*  Open file           */
  477.  
  478. if( state = "READY:" ) then do                  /*  If opened ok        */
  479.  
  480.     if(lines(cfgfile) > 0) then do              /*  And contains data   */
  481.     
  482.         fileline = 0;                           /*  Set filelines       */
  483.                 
  484.         do while lines(cfgfile)                 /*  While more lines    */
  485.         
  486.             fileline = fileline+1;              /*  Have a valid one    */
  487.         
  488.             PARSE VALUE linein(cfgfile) WITH option delim parm1 parm2
  489.             
  490.             /*--------------------------------------*/ 
  491.             /*  Clean option from blanks and check  */
  492.             /*--------------------------------------*/ 
  493.             
  494.             option = translate(strip(option));
  495.             
  496.             /*--------------------------------------*/ 
  497.             /*  If blank or comment ignore process  */
  498.             /*--------------------------------------*/ 
  499.             
  500.             if( option = "" | pos('#',option) = 1) then nop;
  501.             
  502.             /*  Assign Alias Options    */
  503.             
  504.             /*--------------------------------------*/
  505.             /*  Assign alias members to array off   */
  506.             /*  the config trunk                    */
  507.             /*--------------------------------------*/             
  508.  
  509.             else if(option = "ALIAS") then do
  510.                 parm1 = CheckComment(strip(parm1));
  511.                 if(parm1 <> "") then do
  512.                     parm2=CheckComment(strip(parm2));
  513.                     if(parm2 <> "")   then do
  514.                         t = Config.maxalias;
  515.                         Config.t = parm1;
  516.                         Config.t.parm1 = parm2;
  517.                         t = t+1
  518.                         Config.maxalias = t;
  519.                         end
  520.                     else do
  521.                         r=lineout(,"Line: "fileline" invalid");
  522.                         end
  523.                     end
  524.                     
  525.                 else do
  526.                     r=lineout(,"Line: "fileline" contains null alias");
  527.                     end
  528.                 end
  529.                 
  530.             /*--------------------------------------*/
  531.             /*  Assign volume lookaside for easy    */
  532.             /*  movement control                    */
  533.             /*--------------------------------------*/
  534.             
  535.             else if( option = "VOL") then do
  536.                 parm1 = CheckComment(strip(parm1));
  537.                 if(parm1 <> "") then do
  538.                     parm2 = CheckComment(strip(parm2));
  539.                     if(parm2 <> "") then do
  540.                         t = Config.maxvol;
  541.                         Config.VOLSERS.t = parm1;
  542.                         Config.VOLSERS.t.0 = parm2;
  543.                         t = t+1;
  544.                         Config.maxvol = t;
  545.                         end
  546.                     else do
  547.                         r=lineout(,"VOL" parm1" set to . at line" fileline);
  548.                         end
  549.                     end
  550.                 else do
  551.                     r=lineout(,"VOL statement line" fileline" contains null");
  552.                     end
  553.                 end
  554.                 
  555.             /*--------------------------------------*/
  556.             /*  Assign Directorys for home and      */
  557.             /*  Help manuals                        */
  558.             /*--------------------------------------*/
  559.             
  560.             else if(option = "HOME") then do
  561.                 parm1 = CheckComment(strip(parm1));
  562.                 if(parm1 <> "") then do
  563.                     CntlShell.Home = parm1;
  564.                     end
  565.                 end                         /*  End Home assigns    */
  566.                 
  567.             else if(option = "HELP") then do
  568.                 parm1=CheckComment(strip(parm1));
  569.                 if(parm1 <> "") then do
  570.                     CntlShell.Help = parm1;
  571.                     end
  572.                 end                         /*  End Help assigns    */
  573.                 
  574.             /*--------------------------------------*/ 
  575.             /*  Assign leaf to step                 */
  576.             /*  Using the function branch members   */
  577.             /*--------------------------------------*/
  578.             
  579.             else do
  580.                 parm1=CheckComment(strip(parm1));
  581.                 if(parm1 <> "") then do
  582.                     t = Config.maxcfg;
  583.                     Config.FUNCTIONS.t = option
  584.                     Config.FUNCTIONS.t.0 = parm1;
  585.                     t = t+1;
  586.                     Config.maxcfg = t;
  587.                     end
  588.                 else do
  589.                     r=lineout(,Config.option "set to . at Fileline :"fileline);
  590.                     end
  591.                 end                         /*  End Config assigns  */
  592.             
  593.             end                             /*  End DoWhile Lines   */
  594.  
  595.         if(CntlShell.Cfg = "") then do
  596.             CntlShell.Cfg = cfgfile; 
  597.             end
  598.             
  599.         state = stream(cfgfile,c,"CLOSE"); 
  600.         
  601.         if(CntlShell.Home = "")  then do
  602.             CntlShell.Home = CntlShell.CurDir;
  603.             end
  604.             
  605.         if(CntlShell.Help = "") then do
  606.             CntlShell.Help = CntlShell.CurDir;
  607.             end
  608.         
  609.         end                                 /*  End if file found   */
  610.         
  611.     else do
  612.         state = stream(cfgfile,c,"CLOSE"); 
  613.         r=lineout(,"Configuration file not found!");
  614.         'del' cfgfile;
  615.         end                                 /*  End empty file      */
  616.         
  617.     end                                     /*  End open ready      */
  618.     
  619. else do
  620.     r=lineout(,"File open error on" cfgfile "="stream(cfgfile,'D'));
  621.     end
  622.  
  623. return state;
  624.  
  625. /*------------------------------------------------------*/
  626. /*  Changes drive and directory location                */
  627. /*------------------------------------------------------*/
  628.  
  629. Cdd: procedure expose CntlShell.
  630. Arg DriveAndDirect
  631.  
  632. CntlShell.CurDir = directory(DriveAndDirect);
  633.  
  634. return 0;
  635.  
  636. /*------------------------------------------------------*/
  637. /*  Direct and Indirect operating system call           */
  638. /*------------------------------------------------------*/
  639.  
  640. BaseExec: procedure expose Config.
  641. Arg OsCall
  642.  
  643. hit   = 0;
  644.  
  645. parse var OsCall Command Rest
  646.  
  647. if(strip(Rest) = '?') then do
  648.     r=charout(,"Enter option(s) for" Command "call : ");
  649.     parse value linein() with Rest
  650.     end
  651.     
  652. else do
  653.     if ( wordpos("using",Command) | wordpos("USING",Command)) then do
  654.         parse var Rest indirect Rest
  655.         if( strip(Rest) = '?') then do
  656.             r=charout(,"Enter option(s) for" indirect "call : ");
  657.             parse value linein() with Rest
  658.             end
  659.         Command = CheckConfig(strip(indirect));
  660.         hit = 1;
  661.         
  662.         if(Command <> "") then do
  663.             Command Rest
  664.             end
  665.             
  666.         else do
  667.             r=lineout(,"Error processing indirect" indirect Rest);
  668.             end    
  669.         end
  670.     end
  671.        
  672. if(hit = 0) then do 
  673.     Command Rest
  674.     end
  675. return 0;
  676.  
  677. /*------------------------------------------------------*/
  678. /*  Checks string for comment character                 */
  679. /*------------------------------------------------------*/
  680. CheckComment: procedure
  681.  
  682. string = Arg(1);                    /*  Passed string   */
  683.  
  684. if(string <> "") then do            /*  If not null     */
  685.     t=pos("#",string);              /*  Check control   */
  686.     if(t) then do                   /*  If we have it   */
  687.         string = left(string,t);    /*  Copy prefix     */
  688.         end
  689.     end
  690.     
  691. return string;                      /*  Return results  */
  692.  
  693. /*------------------------------------------------------*/
  694. /*  Checks the alias list for a match and operation     */
  695. /*------------------------------------------------------*/
  696. CheckAlias: procedure expose Config.
  697.  
  698. Parse Arg InComing Rest
  699.  
  700. rc=1
  701. t=0;
  702.  
  703. do while(t < Config.maxalias)
  704.     if(COMPARE(Config.t,InComing) = 0) then do
  705.         rc = 0;
  706.         PARSE UPPER VAR Config.t.InComing command argument
  707.         if(command = 'EXEC') then do
  708.             rc=BaseExec(argument);
  709.             t = Config.maxalias;
  710.             end
  711.         else do
  712.             end
  713.         end
  714.     t = t+1
  715.     end
  716.  
  717. return rc;
  718.  
  719. /*------------------------------------------------------*/
  720. /*  Checks the configuration function list for the      */ 
  721. /*  passed parameter and returns match string if found  */
  722. /*------------------------------------------------------*/ 
  723. CheckConfig: procedure  expose Config.
  724.  
  725. Parse Upper Arg InComing Rest
  726.  
  727. i = 0;
  728. match = "";
  729.  
  730. do while ( i < Config.maxcfg )
  731.     if(InComing = Config.FUNCTIONS.i) then do
  732.         match = Config.FUNCTIONS.i.0;
  733.         i = Config.maxcfg;        
  734.         end
  735.     i = i+1;
  736.     end
  737.  
  738. return match;
  739.  
  740. /*------------------------------------------------------*/ 
  741. /*  Checks the volser list for a match with the passed  */
  742. /*  parameter and returns matching string if found      */
  743. /*------------------------------------------------------*/
  744. CheckVolumes: procedure expose Config.
  745.  
  746. InComing = Arg(1);
  747.  
  748. match = "";
  749. i = 0;
  750.     
  751. do while( i < Config.maxvol )
  752.     if( InComing = Config.VOLSERS.i) then do
  753.         match = Config.VOLSERS.i.0;
  754.         i = Config.maxvol;
  755.         end
  756.     i = i+1;
  757.     end
  758.     
  759. return match;
  760.  
  761. /*
  762. $Log:    devshell.cmd $
  763. Revision 1.7  91/12/08  12:55:53  FJC
  764. Tested indirect rexx call as alias command
  765.  
  766. */